<header class="navbar navbar-fixed-top bs-docs-nav">
    <div class='container'>
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="/" class="navbar-brand hidden-sm">
                <img src="https://winhc.oss-cn-shanghai.aliyuncs.com/new_website/logo.png" class='img-responsive' alt='上海债权律师' rel="nofollow"/>
            </a>
        </div>
        <div style="display:none;"><h1><a href="https://www.winhc.cn/">上海债权律师</a></h1><span>上海诉讼律师、上海建筑工程律师、上海工程款律师、工程款诉讼案件、北京全风险代理</span></div>
        <nav id="bs-navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li>
                    <a id="homeTab" href="/">首页</a>
                </li>
                <li class="dropdown dropdown1">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                        <span id="dropdown-title">诉讼投资</span>
                        <span class="caret caret1"></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu1" style="background-color: #222">
                        <li><a id="investTab" href="/calssic_1.html" >诉讼投资</a></li>
                        <li><a id="freeFightTab" href="/calssic_3.html" >案件诊断</a></li>
                        <!--<li><a id="performTab" href="/calssic_2.html">执行服务</a></li>-->
                        <li><a id="acquisitionTab" href="/calssic_4.html">债权销售</a></li>
                    </ul>
                </li>
                <li><a id="university" href="/university.html">赢·公益行</a></li>
                <li><a id="news" href="/news_1.html">新闻动态</a></li>
                <li><a id="aboutTab" href="/aboutUs.html">关于我们</a></li>
                <li class="dropdown dropdown3">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                        <span id="loginTab">注册/登录</span>
                        <span class="caret caret3"></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu3" style="background-color: #222">
                        <li><a id="out_login" href="">退出登录</a></li>
                    </ul>
                </li>
            </ul>
        </nav>
    </div>
</header>
<script>
    $(function(){
        //查看是否登录过
        var loginReturnData = sessionStorage.getItem("sessionGlobalLoginData");
        var phoneStr,phone;
        if(loginReturnData){
            console.log('有')
            $('.caret3').css('display','inline-block')
            $('.dropdown-menu3').css({'display':'block','border':'0'})
            phoneStr = JSON.parse(JSON.parse(loginReturnData).body).mobileNo;
            phone = phoneStr.substring(0,3) + "****" + phoneStr.substring(7,12);
            $("#loginTab").text(phone);
        }else{
            console.log('无')
            $('.caret3').css('display','none')
            $('.dropdown-menu3').css({'display':'none','border':'0'})
            $("#loginTab").text("注册/登录");
        }
        $("#loginTab").click(function () {
            if(loginReturnData){
                window.location.href = "/mine.html"
            }else{
                window.location.href = "/login.html"
            }
        });
        $('#out_login').click(function() {
            console.log('点击了')
            sessionStorage.setItem("sessionGlobalLoginData","");
            sessionStorage.setItem("loginUserExtData","");
            loginReturnData = ''
            $('.caret3').css('display','none')
            $('.dropdown-menu3').css({'display':'none','border':'0'})
//            userLogout();
        })

        //退出登录
        function userLogout(){
            var headerInfo = {},bizInfo = {};
            headerInfo.pageNum = '';
            headerInfo.pageSize = '';
            headerInfo.sessionId = '';

            bizInfo.mobileNo = phone;
            $.ajax({
                url:'/biz.ajax',
                method:'get',
                cache:false,
                headers: {
                    "Accept" : "text/plain; charset=utf-8",
                    "Content-Type": "text/plain; charset=utf-8"
                },
                data:{
                    'serviceName': userLogout,
                    'headerInfo': JSON.stringify(headerInfo),
                    'bizInfo': JSON.stringify(bizInfo)
                },
                success:function(data,textStatus,jqXHR){
                    console.log("你好=",data)
                    sessionStorage.setItem("sessionGlobalLoginData","");
                    sessionStorage.setItem("loginUserExtData","");
                    loginReturnData = ''
                    $("#loginTab").text("注册/登录");
                },
                error:function(xhr,textStatus){
                    console.log('失败=',xhr)
                }
            })
        }

        $('#freeFightTab').click(function() {
            var value = $(this).text();
            console.log('value',value)
            $('#dropdown-title').text(value)
        })

        $('li.dropdown1').mouseover(function() {
            $('.dropdown-toggle .caret1').addClass('hoverCSS')
            $(this).addClass('open');
            $('.dropdown .dropdown-menu1').addClass('hoverCss');
        }).mouseout(function() {
            $('.dropdown-toggle .caret1').removeClass('hoverCSS')
            $(this).removeClass('open');
            $('.dropdown .dropdown-menu1').removeClass('hoverCss');
        });

        $('li.dropdown3').mouseover(function() {
            $('.dropdown-toggle .caret3').addClass('hoverCSS')
            $(this).addClass('open');
            $('.dropdown .dropdown-menu3').addClass('hoverCss');
        }).mouseout(function() {
            $('.dropdown-toggle .caret3').removeClass('hoverCSS')
            $(this).removeClass('open');
            $('.dropdown .dropdown-menu3').removeClass('hoverCss');
        });

        $('.dropdown2').mouseover(function() {
//            $('.dropdown-toggle .caret2').addClass('hoverCSS')
            $(this).addClass('open');
            $('.dropdown .dropdown-menu2').addClass('hoverCss');
        }).mouseout(function() {
//            $('.dropdown-toggle .caret2').removeClass('hoverCSS')
            $(this).removeClass('open');
            $('.dropdown .dropdown-menu2').removeClass('hoverCss');
        });


    })

</script>
